#ifndef __SGM51242R8_H
#define __SGM51242R8_H
#include "spi.h"
#include "stdio.h"

#define SPI1_CS_Enable() HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_RESET)
#define SPI1_CS_Disable() HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_SET)
#define SPI2_CS_Enable() HAL_GPIO_WritePin(GPIOD, GPIO_PIN_2, GPIO_PIN_RESET)
#define SPI2_CS_Disable() HAL_GPIO_WritePin(GPIOD, GPIO_PIN_2, GPIO_PIN_SET)

void Inf_SGM51242R8_SendData(SPI_HandleTypeDef *hspix, uint16_t *data);

void Inf_SGM51242R8_Device2Receive(SPI_HandleTypeDef *hspix, uint16_t *data);
void Inf_SGM51242R8_Device1Receive(SPI_HandleTypeDef *hspix, uint16_t *data);

void Inf_SGM51242R8_Init(SPI_HandleTypeDef *hspix);
void Inf_SGM51242R8_ReadBack(SPI_HandleTypeDef *hspix);


#endif

